/**
 * 找到最高海拔
 *
 * @USER: Administrator
 * @DATE: 2024/9/27 下午10:25
 * @VERSION: 1.0.0
 */
public class LC1732 {
    public static void main(String[] args) {

    }

    public int largestAltitude(int[] gain) {
        int max=0;
        int sum=0;
        for (int j : gain) {
            sum += j;
            if (sum > max) {
                max = sum;
            }
        }
        return max;
    }

}
